function Util(){  		
	//////////////////////////////////////
	// HTML insertion
	this.insertHTML=function(elem,htmlStr,pos) {
		if(typeof(elem)=="string") elem=document.getElementById(elem);
		if(!pos)
			elem.innerHTML=htmlStr;
		else if(pos=="start")
			elem.innerHTML=htmlStr+elem.innerHTML;
		else if(pos=="end")
			elem.innerHTML=elem.innerHTML+htmlStr;
	};
	this.insertHTMLAtTopOf=function(elem,htmlStr) {
		this.insertHTML(elem,htmlStr,"top");
	};
	this.insertHTMLAtBottomOf=function(elem,htmlStr) {
		this.insertHTML(elem,htmlStr,"bottom");
	};
	//////////////////////////////////////
	// Toggle display/visibility styles
	this.toggleDisplay=function(elem,displayStyle) {
		if(typeof(elem)=="string") elem=document.getElementById(elem);
		elem.style.display=displayStyle;
	};
	this.toggleVisibility=function(elem,visibilityStyle) {
		if(typeof(elem)=="string") elem=document.getElementById(elem);
		elem.style.visibility=visibilityStyle;
	};
	//////////////////////////////////////
	// Add/remove specified classname to/from element
	this.addClassNameTo=function(elem,className) {
		if(typeof(elem)=="string") elem=document.getElementById(elem);
		var currClassName=elem.className;
		var patternToCheck=new RegExp("\w?"+className);
		if(!currClassName.match(patternToCheck))
			elem.className=(currClassName.length>=1)? currClassName+" "+className:className;
	};
	this.removeClassNameFrom=function(elem,className) {
		if(typeof(elem)=="string") elem=document.getElementById(elem);
		if(typeof(className)!="object") className=[className];
		var currClassName=elem.className;
		for(var i=0; i<className.length; i++) {
			var patternToRemove=new RegExp("\w?"+className[i],"g");
			elem.className=currClassName.replace(patternToRemove,"");
		}
	};
	this.getElementsByClassName=function(oElm, strTagName, strClassName){
		var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
		var arrReturnElements = new Array();
		strClassName = strClassName.replace(/\-/g, "\\-");
		var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
		var oElement;
		for(var i=0; i<arrElements.length; i++){
			oElement = arrElements[i];
			if(oRegExp.test(oElement.className)){
				arrReturnElements.push(oElement);
			}
		}
		return (arrReturnElements)
	}

	this.removeChildren=function(elem) {
		if ( elem.hasChildNodes() )
		{
				while ( elem.childNodes.length >= 1 )
				{
						elem.removeChild( elem.firstChild );       
				} 
		}
	}
	this.getNode=function(context,tag){
		if(context.getElementsByTagNameNS && (-1 != tag.indexOf(':'))){
			var tagArray = tag.split(':');
			tag = tagArray[tagArray.length-1];
			return context.getElementsByTagNameNS('*', tag);
		}
		return context.getElementsByTagName(tag);
	}
}